﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DynamicProxy.Core.AutoProxy
{
    public class ProxyFactory<T> where T : IInterceptor, new()
    {
        public S CreateInstance<S>() where S : class
        {
            return (S)Activator.CreateInstance(ProxyTypeCollection<T>.Instance()[typeof(S)].Proxy);
        }

        public object CreateInstance(Type type)
        {
            return Activator.CreateInstance(ProxyTypeCollection<T>.Instance()[type].Proxy);
        }
    }
}
